<?php

class omeanalysts_mdl_orderformreport extends dbeav_model{
    
    function GetReportData($start_date) {
        
        $sql = "select * from (
					select A.`name`,count(B.delivery_id) qty from sdb_ome_shop A
					inner join sdb_wms_delivery B on A.shop_id=B.shop_id
					where B.status=3 and B.process_status=7
					and b.deliverynote_time>unix_timestamp('$start_date 00:00:00')
					and b.deliverynote_time<=unix_timestamp('$start_date 23:59:59')
					group by A.`name`
				)T ORDER BY t.qty desc ";
        $rows = $this->db->select($sql);
        return $rows;
    }  
}